<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<html>
<head>
<%@include file="/common/taglibs.jsp"%>
<title>日志管理</title>
<%@include file="/common/ec.jsp"%>
<%@include file="/common/extjs.jsp" %>
<%@include file="/common/meta.jsp"%>
</head>
<body>
<div class="x-panel">
<div class="x-panel-header">日志管理</div>
<div class="x-toolbar">
<table width="99%">
	<tr>
		<td>
		<form id="search" action="index.do" method="post">
			 &nbsp;标题：
		    <s:textfield name="model.title"></s:textfield>&nbsp;&nbsp;
		           类别： <s:select id="diaryTypeMap" list="diaryTypeMap" name="model.diaryType.id" headerKey="" 
                 headerValue="请选择" cssStyle="width:120px;" />
		           时间：
			<input type="text" name="beginTime" style="width: 100px"
				value='<s:date name="beginTime" format="yyyy-MM-dd"/>'
				onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
				class="Wdate" />
			至
			<input type="text" name="endTime" style="width: 100px"
				value='<s:date name="endTime" format="yyyy-MM-dd"/>'
				onfocus="WdatePicker({minDate:'#F{$dp.$D(\'beginTime\')}',skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
				class="Wdate" />
			<s:submit value="查询" cssClass="button"></s:submit>
		</form>
		</td>
		<td align="right">
		  <table>
			<tr>
               <td valign="middle"><a href="edit.do"><img src="${ctx}/images/icons/add.gif" />新建日志</a></td>
			</tr>
		  </table>
		</td>
	</tr>
</table>
</div>
<div class="x-panel-body">
<ec:table
	items="items" 
	var="item" 
	retrieveRowsCallback="process"
	sortRowsCallback="process" 
	action="index.do" 
	useAjax="false"
	doPreload="false" 
	pageSizeList="20,50,100,200" 
	editable="false"
	sortable="false" 
	rowsDisplayed="20" 
	generateScript="true"
	resizeColWidth="false" 
	classic="false" 
	width="100%" 
	height="460px"
	minHeight="460"
	toolbarContent="navigation|pagejump|pagesize|refresh|extend|status">
	<ec:row>
	    <ec:column width="40" property="_s" title="No." value="${GLOBALROWCOUNT}" sortable="false" style="text-align:center"/>
		<ec:column width="350" property="_title" title="标题">
			<a href="${ctx}/diary/view.do?model.id=${item.id}" title="查看日志" target="_blank"><font color="blue">${item.title}</font></a>
		</ec:column>
		<ec:column width="120" property="diaryType.name" title="类别" style="text-align:left"  />
		<ec:column width="140" property="createDate" title="时间" style="text-align:center" format="yyyy-MM-dd HH:mm" cell="date"/>
		<ec:column width="180" property="_0" title="操作" style="text-align:center" sortable="false">
	    <a href="${ctx}/diary/view.do?model.id=${item.id}" title="查看日志">查看 </a> |
		<a href="${ctx}/diary/edit.do?model.id=${item.id}" title="修改日志">编辑</a> | 
		<a href="#" onclick="remove(${item.id})" title="删除日志">删除</a>    	
		</ec:column>
	</ec:row>
</ec:table>
</div>
</div>
<script type="text/javascript">
  function remove(id) {
    Ext.MessageBox.confirm('提示','确认要删除所选择的日志吗？删除后不能恢复！', function(btn){
        if (btn == 'yes') {
          window.location = "${ctx}/diary/remove.do?model.id=" + id;
        }
    });
  }
	
  function refresh() {
    ECSideUtil.reload('ec');
  }
</script>
</body>
</html>